<html>
<head><meta charset="utf-8"><title>Trait object upcast · wg-traits · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/index.html">wg-traits</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Trait.20object.20upcast.html">Trait object upcast</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="135419540"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Trait%20object%20upcast/near/135419540" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> dhardy <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Trait.20object.20upcast.html#135419540">(Oct 08 2018 at 18:09)</a>:</h4>
<p>Hello people!</p>
<p>I've been looking at <a href="https://github.com/rust-lang/rfcs/issues/2035" target="_blank" title="https://github.com/rust-lang/rfcs/issues/2035">https://github.com/rust-lang/rfcs/issues/2035</a> and trying to work out the simplest bit: trait-object upcast (single inheritance). I'm not familiar with the compiler, so that's the first hurdle...</p>



<a name="147612768"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Trait%20object%20upcast/near/147612768" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Trait.20object.20upcast.html#147612768">(Nov 13 2018 at 18:01)</a>:</h4>
<p>hi <span class="user-mention" data-user-id="131912">@dhardy</span>. have you gotten anywhere with this yet?</p>



<a name="147653013"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Trait%20object%20upcast/near/147653013" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> dhardy <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Trait.20object.20upcast.html#147653013">(Nov 14 2018 at 08:06)</a>:</h4>
<p>Hi <span class="user-mention" data-user-id="124069">@Alexander Regueiro</span>. Unfortunately not; I spent a couple of hours trying to understand the relevant bits of the compiler but didn't get anywhere.</p>



<a name="147676475"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Trait%20object%20upcast/near/147676475" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Trait.20object.20upcast.html#147676475">(Nov 14 2018 at 15:24)</a>:</h4>
<p>Yeah, it's pretty complex. I believe it's been discussed however, so perhaps <span class="user-mention" data-user-id="116009">@nikomatsakis</span> (or <span class="user-mention" data-user-id="131694">@scalexm</span>) have some ideas.</p>



<a name="147676478"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Trait%20object%20upcast/near/147676478" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Trait.20object.20upcast.html#147676478">(Nov 14 2018 at 15:24)</a>:</h4>
<p>I'd like to help you on it if possbile.</p>



<a name="147676484"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Trait%20object%20upcast/near/147676484" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Trait.20object.20upcast.html#147676484">(Nov 14 2018 at 15:24)</a>:</h4>
<p>Haven't looked into it properly yet though.</p>



<a name="147986701"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Trait%20object%20upcast/near/147986701" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Trait.20object.20upcast.html#147986701">(Nov 19 2018 at 19:11)</a>:</h4>
<p><span class="user-mention" data-user-id="124069">@Alexander Regueiro</span> if we could at least make "simple cases" work here it seems like it'd be a huge win. I was thinking about it this morning, maybe I can leave some notes somewhere</p>



<a name="147991125"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Trait%20object%20upcast/near/147991125" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Trait.20object.20upcast.html#147991125">(Nov 19 2018 at 20:06)</a>:</h4>
<p>Yeah, that would be cool. Leave some notes in the RFC repo you created a while ago (I have access to it too)?</p>



<a name="148025067"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Trait%20object%20upcast/near/148025067" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> dhardy <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Trait.20object.20upcast.html#148025067">(Nov 20 2018 at 08:44)</a>:</h4>
<p>Simple upcast would be a huge improvement. No more need to have <code>as_any(&amp;self) -&gt; &amp;Any</code> methods (and <code>mut</code> versions), so it's useful for downcasting as well as up.</p>



<a name="148048980"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Trait%20object%20upcast/near/148048980" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Trait.20object.20upcast.html#148048980">(Nov 20 2018 at 16:03)</a>:</h4>
<p><span class="user-mention" data-user-id="131912">@dhardy</span> with downcast... how so?</p>



<a name="148054405"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Trait%20object%20upcast/near/148054405" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> dhardy <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Trait.20object.20upcast.html#148054405">(Nov 20 2018 at 17:26)</a>:</h4>
<p>For <code>trait T: Any</code>, implementing the <code>&amp;T → &amp;Any</code> cast allows <code>obj.downcast_ref::&lt;X&gt;()</code> for <code>obj: &amp;T</code>. To do this now, we need to add methods like <code>fn as_any(&amp;self) -&gt; &amp;Any</code> to trait <code>T</code>, then call <code>obj.as_any().downcast_ref::&lt;X&gt;()</code>.</p>
<p>But this is just a potential application, nothing to do with the implementation. Would love to have this feature.</p>



<a name="148059995"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Trait%20object%20upcast/near/148059995" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Trait.20object.20upcast.html#148059995">(Nov 20 2018 at 19:08)</a>:</h4>
<p><span class="user-mention" data-user-id="131912">@dhardy</span> I don't fully get how <code>Any</code> works internally (some sort of compiler built-in to get the <code>TypeId</code>?) . I haven't encountered <code>as_any</code> methods before either. How would it look with upcasting?</p>



<a name="148060556"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Trait%20object%20upcast/near/148060556" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> dhardy <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Trait.20object.20upcast.html#148060556">(Nov 20 2018 at 19:17)</a>:</h4>
<p>Yes, it's just a shim around <code>TypeId</code> and reference casting.</p>



<a name="148061693"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Trait%20object%20upcast/near/148061693" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Trait.20object.20upcast.html#148061693">(Nov 20 2018 at 19:33)</a>:</h4>
<p>ah right.</p>



<a name="148061755"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Trait%20object%20upcast/near/148061755" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Trait.20object.20upcast.html#148061755">(Nov 20 2018 at 19:34)</a>:</h4>
<p>so how is the information about the type stored at runtime?</p>



<a name="148061771"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Trait%20object%20upcast/near/148061771" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> dhardy <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Trait.20object.20upcast.html#148061771">(Nov 20 2018 at 19:34)</a>:</h4>
<p>You know you can click on the <code>[src]</code> link by <a href="https://doc.rust-lang.org/std/any/trait.Any.html#method.is" target="_blank" title="https://doc.rust-lang.org/std/any/trait.Any.html#method.is">implementations</a> right? Very convenient way to find out how things work.</p>



<a name="148061790"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Trait%20object%20upcast/near/148061790" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Trait.20object.20upcast.html#148061790">(Nov 20 2018 at 19:34)</a>:</h4>
<p><span class="user-mention" data-user-id="131912">@dhardy</span> Err no. Haha. Since when has that existed? I feel like a fool now.</p>



<a name="148061816"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Trait%20object%20upcast/near/148061816" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> dhardy <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Trait.20object.20upcast.html#148061816">(Nov 20 2018 at 19:35)</a>:</h4>
<p>Don't know; I think it's fairly new.</p>



<a name="148061849"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Trait%20object%20upcast/near/148061849" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> dhardy <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Trait.20object.20upcast.html#148061849">(Nov 20 2018 at 19:35)</a>:</h4>
<p>Regarding your other question: I don't know; it's the magic of <code>TypeId</code>... probably some data stored in the vtable.</p>



<a name="148061910"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Trait%20object%20upcast/near/148061910" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Trait.20object.20upcast.html#148061910">(Nov 20 2018 at 19:36)</a>:</h4>
<p>makes sense</p>



<a name="148061923"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Trait%20object%20upcast/near/148061923" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> dhardy <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Trait.20object.20upcast.html#148061923">(Nov 20 2018 at 19:36)</a>:</h4>
<p>It's an intrinsic so the API docs don't tell me anything: <a href="https://doc.rust-lang.org/std/intrinsics/fn.type_id.html" target="_blank" title="https://doc.rust-lang.org/std/intrinsics/fn.type_id.html">https://doc.rust-lang.org/std/intrinsics/fn.type_id.html</a></p>



<a name="148061942"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Trait%20object%20upcast/near/148061942" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Trait.20object.20upcast.html#148061942">(Nov 20 2018 at 19:36)</a>:</h4>
<p>indeed</p>



<a name="148061974"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Trait%20object%20upcast/near/148061974" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> dhardy <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Trait.20object.20upcast.html#148061974">(Nov 20 2018 at 19:37)</a>:</h4>
<p>The first step here is to be able to convert a <code>&amp;A</code> to <code>&amp;B</code> where <code>A: B</code>.</p>



<a name="148062021"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Trait%20object%20upcast/near/148062021" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Trait.20object.20upcast.html#148062021">(Nov 20 2018 at 19:38)</a>:</h4>
<p><span class="user-mention" data-user-id="131912">@dhardy</span> Anyway, this is just a nice bonus, as you say. I'd really like to get upcasting implemented in the compiler (and after that multi-trait objects). Let's have a chat with <span class="user-mention" data-user-id="116009">@nikomatsakis</span> about it soon, I think.</p>



<a name="148062023"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Trait%20object%20upcast/near/148062023" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Trait.20object.20upcast.html#148062023">(Nov 20 2018 at 19:38)</a>:</h4>
<p>yes</p>



<a name="148062033"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Trait%20object%20upcast/near/148062033" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> dhardy <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Trait.20object.20upcast.html#148062033">(Nov 20 2018 at 19:38)</a>:</h4>
<p>I don't know the best way of doing that — maybe the vtable pointer can simply be adjusted, or maybe a pointer can be added to the appropriate <code>&amp;A</code> vtable</p>



<a name="148062083"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Trait%20object%20upcast/near/148062083" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> dhardy <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Trait.20object.20upcast.html#148062083">(Nov 20 2018 at 19:39)</a>:</h4>
<p>Something I'd love to see, but I really don't know where to start in the compiler and have several other things to work on, so don't really want to put in a lot of effort there myself</p>



<a name="148063954"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Trait%20object%20upcast/near/148063954" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Trait.20object.20upcast.html#148063954">(Nov 20 2018 at 20:04)</a>:</h4>
<p>Well, we should discuss it first. Then draft up an RFC, since that still needs to be written. Maybe you could just help with that side of things and leave implementation to someone else.</p>



<a name="148285423"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Trait%20object%20upcast/near/148285423" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> dhardy <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Trait.20object.20upcast.html#148285423">(Nov 24 2018 at 17:45)</a>:</h4>
<p>Can you point me to whichever part of the compiler defines the vtables currently (or the current specification)?</p>



<a name="148294367"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Trait%20object%20upcast/near/148294367" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Trait.20object.20upcast.html#148294367">(Nov 24 2018 at 22:57)</a>:</h4>
<p>How do you mean "define"? Codegen is in <code>src/librustc_codegen_llvm/abi.rs</code> (and possibly <code>callee.rs</code> and <code>meth.rs</code>?). they originate during trait selection of course... and there's a lot of MIR-related code that handles them.</p>



<a name="148294369"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Trait%20object%20upcast/near/148294369" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Trait.20object.20upcast.html#148294369">(Nov 24 2018 at 22:57)</a>:</h4>
<p>I'm not an expert however.</p>



<a name="150763994"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Trait%20object%20upcast/near/150763994" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> dhardy <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Trait.20object.20upcast.html#150763994">(Dec 03 2018 at 10:59)</a>:</h4>
<p>I tried having a look at this yesterday but didn't get anywhere. Can you perhaps summarise what the current vtables for trait objects look like?</p>



<a name="150782361"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Trait%20object%20upcast/near/150782361" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Trait.20object.20upcast.html#150782361">(Dec 03 2018 at 16:40)</a>:</h4>
<p><span class="user-mention" data-user-id="131912">@dhardy</span> I think <span class="user-mention" data-user-id="116009">@nikomatsakis</span> will do a better job than me at this. Will you be around in a few hours? There's a Traits WG meeting, so you can ask him then. :-)</p>



<a name="150786625"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Trait%20object%20upcast/near/150786625" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> dhardy <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Trait.20object.20upcast.html#150786625">(Dec 03 2018 at 17:45)</a>:</h4>
<p>Well, the question stands :-)</p>
<p>The first part is, for traits <code>A: B</code>, what is the minimum we have to do to convert a trait object for <code>A</code> to one for <code>B</code>? Can the vtable for <code>A</code> be a valid vtable for <code>B</code>?</p>
<p>The second bit is which mechanism do we use to do the conversion? I think <span class="user-mention" data-user-id="116009">@nikomatsakis</span> mentioned this could be a coercion.</p>
<p>The third part is how does this generalise to multi-trait objects? I don't see why we couldn't start only supporting the easier cases (e.g. allowing <code>A+B</code> to reduce to <code>A</code> and <code>A+B+C</code> to <code>A+B</code> via compatible prefixes). There are some ideas for more general support in the issue linked at the top of this thread.</p>



<a name="150805596"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Trait%20object%20upcast/near/150805596" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Trait.20object.20upcast.html#150805596">(Dec 03 2018 at 22:26)</a>:</h4>
<p><span class="user-mention" data-user-id="131912">@dhardy</span> Fair questions. I wish I could help more... sadly (for us) it seems like <span class="user-mention" data-user-id="116009">@nikomatsakis</span> has a busy week planned, but maybe he'll be able to give this a little time.</p>



<a name="150805603"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Trait%20object%20upcast/near/150805603" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Trait.20object.20upcast.html#150805603">(Dec 03 2018 at 22:26)</a>:</h4>
<p>Also, what do you mean "compatible prefixes"?</p>



<a name="150838409"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Trait%20object%20upcast/near/150838409" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> dhardy <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Trait.20object.20upcast.html#150838409">(Dec 04 2018 at 10:56)</a>:</h4>
<p>As it happens, I also have a busy week. I mean, is the first part of the vtable for <code>A+B+C</code> also a valid vtable for <code>A+B</code>? Hopefully we can construct them that way, which makes many upcasts trivial.</p>



<a name="150860361"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Trait%20object%20upcast/near/150860361" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Trait.20object.20upcast.html#150860361">(Dec 04 2018 at 16:43)</a>:</h4>
<p><span class="user-mention" data-user-id="131912">@dhardy</span> Well, in general you can't guarantee ordering, whatever that ordering is. Since you may want to go from <code>A + B + C</code> -&gt; <code>A + C</code> (unless you're considering that a "non-simple" case?)</p>



<a name="150860377"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Trait%20object%20upcast/near/150860377" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Trait.20object.20upcast.html#150860377">(Dec 04 2018 at 16:43)</a>:</h4>
<p>it's akin to marginalisation (in statistics)</p>



<a name="150860438"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Trait%20object%20upcast/near/150860438" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Trait.20object.20upcast.html#150860438">(Dec 04 2018 at 16:44)</a>:</h4>
<p>I suspect you can reuse such tables even in the general case.</p>



<a name="150862714"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Trait%20object%20upcast/near/150862714" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> dhardy <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Trait.20object.20upcast.html#150862714">(Dec 04 2018 at 17:20)</a>:</h4>
<p>I see... if we can't guarantee ordering of traits within vtables then we can't offer support for <code>A+B+C → A+B</code> without also supporting <code>A+B+C→A+C</code>. And I guess we can't guarantee ordering because we want <code>Box&lt;A+B&gt;</code> to be equivalent to <code>Box&lt;B+A&gt;</code>.</p>
<p>Can we support <code>A+B+C → B</code> by simply adjusting the vtable pointer? I guess since we don't <em>have</em> multi-trait-objects yet this is more a design pointer for that.</p>
<p>What I would like to know is exactly what information is included in vtables: obviously function pointers and presumably also some unique identifier to make <code>TypeId</code> work. Maybe also the data size?</p>
<p>If the vtable for <code>A+B+C</code> is simply the three vtables concatenated together, repeating any common data like the typeid, then <code>A+B+C → A</code> conversions and some of the <code>A+B+C → A+B</code> type conversions (generalising) are simply pointer offsets, known statically. The other conversions need some other mechanism, e.g. a pointer to the <code>A+C</code> vtable or a statically-compiled map from each <code>A+B+C</code> vtable to the corresponding <code>A+C</code> vtable.</p>
<p>By marginalisation are you talking about optimising the layout of <code>A+B+C</code> depending on usage? I guess that's possible but presumably would have to be a link-time optimisation.</p>



<a name="150863081"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Trait%20object%20upcast/near/150863081" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Trait.20object.20upcast.html#150863081">(Dec 04 2018 at 17:27)</a>:</h4>
<p><span class="user-mention" data-user-id="131912">@dhardy</span> well, there's this annoying concept of a "principal trait" in trait objects right now, which gets in the way</p>



<a name="150863086"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Trait%20object%20upcast/near/150863086" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Trait.20object.20upcast.html#150863086">(Dec 04 2018 at 17:27)</a>:</h4>
<p>I'm not sure what to do about that.</p>



<a name="150863133"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Trait%20object%20upcast/near/150863133" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> dhardy <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Trait.20object.20upcast.html#150863133">(Dec 04 2018 at 17:28)</a>:</h4>
<p>What is it?</p>



<a name="150863142"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Trait%20object%20upcast/near/150863142" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Trait.20object.20upcast.html#150863142">(Dec 04 2018 at 17:28)</a>:</h4>
<p>it's the "main" trait for a trait object</p>



<a name="150863145"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Trait%20object%20upcast/near/150863145" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Trait.20object.20upcast.html#150863145">(Dec 04 2018 at 17:28)</a>:</h4>
<p>the first one, basically</p>



<a name="150863154"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Trait%20object%20upcast/near/150863154" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Trait.20object.20upcast.html#150863154">(Dec 04 2018 at 17:28)</a>:</h4>
<p>it must be non-auto unless all the traits are auto</p>



<a name="150863158"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Trait%20object%20upcast/near/150863158" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> dhardy <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Trait.20object.20upcast.html#150863158">(Dec 04 2018 at 17:28)</a>:</h4>
<p>Because right now secondary ones are only bounds like <code>Send</code> with no functions?</p>



<a name="150863164"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Trait%20object%20upcast/near/150863164" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Trait.20object.20upcast.html#150863164">(Dec 04 2018 at 17:28)</a>:</h4>
<p>yes, they don't alter the vtable whatsoever</p>



<a name="150863167"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Trait%20object%20upcast/near/150863167" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Trait.20object.20upcast.html#150863167">(Dec 04 2018 at 17:28)</a>:</h4>
<p>because they are empty</p>



<a name="150863174"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Trait%20object%20upcast/near/150863174" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Trait.20object.20upcast.html#150863174">(Dec 04 2018 at 17:29)</a>:</h4>
<p>all auto traits are, of course</p>



<a name="150863192"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Trait%20object%20upcast/near/150863192" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> dhardy <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Trait.20object.20upcast.html#150863192">(Dec 04 2018 at 17:29)</a>:</h4>
<p>So what would e.g. <code>Debug+Send</code> → <code>Send</code> mean?</p>



<a name="150863204"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Trait%20object%20upcast/near/150863204" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> dhardy <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Trait.20object.20upcast.html#150863204">(Dec 04 2018 at 17:29)</a>:</h4>
<p>Nothing I guess since you cannot do anything with a <code>Box&lt;Send&gt;</code></p>



<a name="150863208"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Trait%20object%20upcast/near/150863208" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Trait.20object.20upcast.html#150863208">(Dec 04 2018 at 17:29)</a>:</h4>
<p>note that <code>A + B + C</code> isn't a sum of the individual vtables, it's more akin to a product.</p>



<a name="150863277"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Trait%20object%20upcast/near/150863277" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Trait.20object.20upcast.html#150863277">(Dec 04 2018 at 17:30)</a>:</h4>
<p>or a "joint distribution", if we're to retain the statistical analogy</p>



<a name="150863339"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Trait%20object%20upcast/near/150863339" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Trait.20object.20upcast.html#150863339">(Dec 04 2018 at 17:31)</a>:</h4>
<p>well, <code>Box&lt;Send&gt;</code> is still permitted...</p>



<a name="150863392"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Trait%20object%20upcast/near/150863392" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> dhardy <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Trait.20object.20upcast.html#150863392">(Dec 04 2018 at 17:32)</a>:</h4>
<p>The cast does not appear to be permitted currently: <a href="https://play.rust-lang.org/?version=stable&amp;mode=debug&amp;edition=2015&amp;gist=fec38804c19fd39354393f33aab7c200" target="_blank" title="https://play.rust-lang.org/?version=stable&amp;mode=debug&amp;edition=2015&amp;gist=fec38804c19fd39354393f33aab7c200">https://play.rust-lang.org/?version=stable&amp;mode=debug&amp;edition=2015&amp;gist=fec38804c19fd39354393f33aab7c200</a></p>



<a name="150863414"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Trait%20object%20upcast/near/150863414" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Trait.20object.20upcast.html#150863414">(Dec 04 2018 at 17:32)</a>:</h4>
<p>indeed, it's an upcast, which aren't permitted at all right now</p>



<a name="150863420"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Trait%20object%20upcast/near/150863420" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Trait.20object.20upcast.html#150863420">(Dec 04 2018 at 17:32)</a>:</h4>
<p>that would just mean not caring about the <code>Debug</code> "column" in the vtable</p>



<a name="150863448"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Trait%20object%20upcast/near/150863448" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> dhardy <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Trait.20object.20upcast.html#150863448">(Dec 04 2018 at 17:32)</a>:</h4>
<p>Well, <code>&amp;(Debug+Send)</code> → <code>&amp;Debug</code> is already permitted</p>



<a name="150863468"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Trait%20object%20upcast/near/150863468" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Trait.20object.20upcast.html#150863468">(Dec 04 2018 at 17:33)</a>:</h4>
<p>sure, but I mean of objects themselves, not references.</p>



<a name="150863469"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Trait%20object%20upcast/near/150863469" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> dhardy <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Trait.20object.20upcast.html#150863469">(Dec 04 2018 at 17:33)</a>:</h4>
<p>I guess it's just a special case of upcast which drops only auto traits</p>



<a name="150863488"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Trait%20object%20upcast/near/150863488" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> dhardy <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Trait.20object.20upcast.html#150863488">(Dec 04 2018 at 17:33)</a>:</h4>
<p>A trait object is always reference</p>



<a name="150863494"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Trait%20object%20upcast/near/150863494" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Trait.20object.20upcast.html#150863494">(Dec 04 2018 at 17:33)</a>:</h4>
<p>not really</p>



<a name="150863498"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Trait%20object%20upcast/near/150863498" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Trait.20object.20upcast.html#150863498">(Dec 04 2018 at 17:33)</a>:</h4>
<p>it's a fat pointer, you mean?</p>



<a name="150863517"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Trait%20object%20upcast/near/150863517" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> dhardy <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Trait.20object.20upcast.html#150863517">(Dec 04 2018 at 17:34)</a>:</h4>
<p>Oh, it can be a <code>Box</code></p>



<a name="150863545"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Trait%20object%20upcast/near/150863545" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> dhardy <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Trait.20object.20upcast.html#150863545">(Dec 04 2018 at 17:34)</a>:</h4>
<p>that's just an owning reference</p>



<a name="150863552"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Trait%20object%20upcast/near/150863552" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> dhardy <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Trait.20object.20upcast.html#150863552">(Dec 04 2018 at 17:34)</a>:</h4>
<p>But yes, always a fat pointer I think?</p>



<a name="150863559"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Trait%20object%20upcast/near/150863559" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Trait.20object.20upcast.html#150863559">(Dec 04 2018 at 17:34)</a>:</h4>
<p>yes. but when one says "reference", it evokes <code>&amp;</code>/<code>&amp; mut</code> in Rust :-)</p>



<a name="150863565"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Trait%20object%20upcast/near/150863565" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Trait.20object.20upcast.html#150863565">(Dec 04 2018 at 17:34)</a>:</h4>
<p>yes, always a fat pointer</p>



<a name="150863579"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Trait%20object%20upcast/near/150863579" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> dhardy <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Trait.20object.20upcast.html#150863579">(Dec 04 2018 at 17:34)</a>:</h4>
<p>You remember the <code>@</code> references we used to have?</p>



<a name="150863595"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Trait%20object%20upcast/near/150863595" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Trait.20object.20upcast.html#150863595">(Dec 04 2018 at 17:35)</a>:</h4>
<p>only vaguely. I didn't properly take up Rust until 1.0.</p>



<a name="150863603"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Trait%20object%20upcast/near/150863603" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Trait.20object.20upcast.html#150863603">(Dec 04 2018 at 17:35)</a>:</h4>
<p>anyway, I think we could get away with just having a vtable with all potential columns included... e.g. we don't need a separate vtable for <code>A + B, </code>A + C<code>, </code>B + C<code> if we have </code>A + B + C`.</p>



<a name="150863609"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Trait%20object%20upcast/near/150863609" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> dhardy <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Trait.20object.20upcast.html#150863609">(Dec 04 2018 at 17:35)</a>:</h4>
<p>Good thing we lost them I think</p>



<a name="150863625"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Trait%20object%20upcast/near/150863625" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Trait.20object.20upcast.html#150863625">(Dec 04 2018 at 17:35)</a>:</h4>
<p>yep, for sure</p>



<a name="150863641"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Trait%20object%20upcast/near/150863641" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> dhardy <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Trait.20object.20upcast.html#150863641">(Dec 04 2018 at 17:35)</a>:</h4>
<p>Do we not need separate vtables for e.g. <code>A+C</code>?</p>



<a name="150863689"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Trait%20object%20upcast/near/150863689" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> dhardy <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Trait.20object.20upcast.html#150863689">(Dec 04 2018 at 17:36)</a>:</h4>
<p>How would that work?</p>



<a name="150863700"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Trait%20object%20upcast/near/150863700" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> dhardy <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Trait.20object.20upcast.html#150863700">(Dec 04 2018 at 17:36)</a>:</h4>
<p>Very fat pointers (i.e. a separate poniter to each vtable) maybe?</p>



<a name="150864138"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Trait%20object%20upcast/near/150864138" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Trait.20object.20upcast.html#150864138">(Dec 04 2018 at 17:43)</a>:</h4>
<p>I think we can get away without them. That prevents an exponential explosion of vtables too.</p>



<a name="150864146"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Trait%20object%20upcast/near/150864146" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Trait.20object.20upcast.html#150864146">(Dec 04 2018 at 17:43)</a>:</h4>
<p>(in terms of number of tables)</p>



<a name="150864267"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Trait%20object%20upcast/near/150864267" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> dhardy <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Trait.20object.20upcast.html#150864267">(Dec 04 2018 at 17:44)</a>:</h4>
<p>Do we really get an exponential explosion though? Obviously we need <code>A+B+C</code> <em>if this is used</em>, but I don't think we need to generate <code>A+C</code> unless it's actually used.</p>



<a name="150864320"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Trait%20object%20upcast/near/150864320" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> dhardy <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Trait.20object.20upcast.html#150864320">(Dec 04 2018 at 17:45)</a>:</h4>
<p>Well, this might require generating vtables and conversions at link time, so may not be simple to avoid.</p>



<a name="150864370"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Trait%20object%20upcast/near/150864370" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> dhardy <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Trait.20object.20upcast.html#150864370">(Dec 04 2018 at 17:46)</a>:</h4>
<p>Anyway, how do you propose to avoid them?</p>



<a name="150864533"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Trait%20object%20upcast/near/150864533" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Trait.20object.20upcast.html#150864533">(Dec 04 2018 at 17:49)</a>:</h4>
<p>we get an exponential explosion if they're all used</p>



<a name="150864554"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Trait%20object%20upcast/near/150864554" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> dhardy <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Trait.20object.20upcast.html#150864554">(Dec 04 2018 at 17:49)</a>:</h4>
<p>That also requires the user to write a lot of code. So I don't see the problem.</p>



<a name="150864563"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Trait%20object%20upcast/near/150864563" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Trait.20object.20upcast.html#150864563">(Dec 04 2018 at 17:49)</a>:</h4>
<p>it's not necessarily</p>



<a name="150864564"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Trait%20object%20upcast/near/150864564" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Trait.20object.20upcast.html#150864564">(Dec 04 2018 at 17:49)</a>:</h4>
<p>just an observation</p>



<a name="150864640"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Trait%20object%20upcast/near/150864640" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Trait.20object.20upcast.html#150864640">(Dec 04 2018 at 17:50)</a>:</h4>
<p>and actually, I've been thinking about this wrong</p>



<a name="150864647"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Trait%20object%20upcast/near/150864647" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Trait.20object.20upcast.html#150864647">(Dec 04 2018 at 17:50)</a>:</h4>
<p>we do need to generate combintions</p>



<a name="150864658"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Trait%20object%20upcast/near/150864658" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Trait.20object.20upcast.html#150864658">(Dec 04 2018 at 17:50)</a>:</h4>
<p>so yeah, I don't think there's avoiding it without some really fancy lookup scheme</p>



<a name="150864668"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Trait%20object%20upcast/near/150864668" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Trait.20object.20upcast.html#150864668">(Dec 04 2018 at 17:51)</a>:</h4>
<p>which probably adds runtime overhead</p>



<a name="150864672"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Trait%20object%20upcast/near/150864672" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Trait.20object.20upcast.html#150864672">(Dec 04 2018 at 17:51)</a>:</h4>
<p>undesirable, of course</p>



<a name="150864680"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Trait%20object%20upcast/near/150864680" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> dhardy <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Trait.20object.20upcast.html#150864680">(Dec 04 2018 at 17:51)</a>:</h4>
<p>I don't think it's hard actually.</p>



<a name="150864688"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Trait%20object%20upcast/near/150864688" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Trait.20object.20upcast.html#150864688">(Dec 04 2018 at 17:51)</a>:</h4>
<p>in theory, no</p>



<a name="150864691"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Trait%20object%20upcast/near/150864691" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Trait.20object.20upcast.html#150864691">(Dec 04 2018 at 17:51)</a>:</h4>
<p>in practice... may be some gotchas</p>



<a name="150864692"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Trait%20object%20upcast/near/150864692" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Trait.20object.20upcast.html#150864692">(Dec 04 2018 at 17:51)</a>:</h4>
<p>I'm not sure</p>



<a name="150864693"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Trait%20object%20upcast/near/150864693" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> dhardy <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Trait.20object.20upcast.html#150864693">(Dec 04 2018 at 17:51)</a>:</h4>
<p>The compiler can represent <code>A+B+C+D</code> as a collection of traits, and not generate the vtables until link time</p>



<a name="150864706"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Trait%20object%20upcast/near/150864706" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> dhardy <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Trait.20object.20upcast.html#150864706">(Dec 04 2018 at 17:51)</a>:</h4>
<p>That way it only needs to generate <code>A+B+D</code> vtables if used</p>



<a name="150864750"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Trait%20object%20upcast/near/150864750" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Trait.20object.20upcast.html#150864750">(Dec 04 2018 at 17:52)</a>:</h4>
<p>yes</p>



<a name="150864753"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Trait%20object%20upcast/near/150864753" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Trait.20object.20upcast.html#150864753">(Dec 04 2018 at 17:52)</a>:</h4>
<p>that makes sense to me</p>



<a name="150864761"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Trait%20object%20upcast/near/150864761" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> dhardy <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Trait.20object.20upcast.html#150864761">(Dec 04 2018 at 17:52)</a>:</h4>
<p>If <code>A+B+C+D</code> objects are made, then obviously that vtable is needed</p>



<a name="150864766"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Trait%20object%20upcast/near/150864766" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Trait.20object.20upcast.html#150864766">(Dec 04 2018 at 17:52)</a>:</h4>
<p>I think you need to wait until link-time regardless, because of cross-crate scenarios</p>



<a name="150864778"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Trait%20object%20upcast/near/150864778" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> dhardy <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Trait.20object.20upcast.html#150864778">(Dec 04 2018 at 17:52)</a>:</h4>
<p>The compiler doesn't know yet whether a cast to <code>B+D</code> will be needed</p>



<a name="150864810"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Trait%20object%20upcast/near/150864810" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> dhardy <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Trait.20object.20upcast.html#150864810">(Dec 04 2018 at 17:53)</a>:</h4>
<p>So what you do is wait until link time, then <em>if</em> a <code>A+B+C+D</code> → <code>B+D</code> cast is needed, generate a function taking the vtable for the former and returning the latter</p>



<a name="150864815"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Trait%20object%20upcast/near/150864815" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> dhardy <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Trait.20object.20upcast.html#150864815">(Dec 04 2018 at 17:53)</a>:</h4>
<p>i.e. static table lookup</p>



<a name="150864898"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Trait%20object%20upcast/near/150864898" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> dhardy <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Trait.20object.20upcast.html#150864898">(Dec 04 2018 at 17:54)</a>:</h4>
<p>Since the vtable for <code>A+B+C+D</code> is only created (for each object) at link-time, the <code>B+D</code> vtable and conversion can be created at the same time</p>



<a name="150865014"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Trait%20object%20upcast/near/150865014" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> dhardy <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Trait.20object.20upcast.html#150865014">(Dec 04 2018 at 17:56)</a>:</h4>
<p>This is assuming each vtable is at a fixed address — I guess the address may not be known until the problem starts, so this might mean populating the conversion tables at the program start; less than ideal but not a real issue since we only have conversions for the types used at this point</p>



<a name="150865292"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Trait%20object%20upcast/near/150865292" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> dhardy <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Trait.20object.20upcast.html#150865292">(Dec 04 2018 at 18:00)</a>:</h4>
<p>BTW I'd still like to know exactly what data we need in the vtable if you can find out?</p>



<a name="150865531"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Trait%20object%20upcast/near/150865531" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Trait.20object.20upcast.html#150865531">(Dec 04 2018 at 18:04)</a>:</h4>
<p>sure, let me speak to people</p>



<a name="150866120"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Trait%20object%20upcast/near/150866120" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Trait.20object.20upcast.html#150866120">(Dec 04 2018 at 18:12)</a>:</h4>
<p><a href="https://internals.rust-lang.org/t/wheres-the-catch-with-box-read-write/6617" target="_blank" title="https://internals.rust-lang.org/t/wheres-the-catch-with-box-read-write/6617">https://internals.rust-lang.org/t/wheres-the-catch-with-box-read-write/6617</a></p>



<a name="150866122"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Trait%20object%20upcast/near/150866122" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Trait.20object.20upcast.html#150866122">(Dec 04 2018 at 18:12)</a>:</h4>
<p>have you read that yet?</p>



<a name="151733434"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Trait%20object%20upcast/near/151733434" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Trait.20object.20upcast.html#151733434">(Dec 13 2018 at 21:14)</a>:</h4>
<p>CC <span class="user-mention" data-user-id="116009">@nikomatsakis</span>, this is what I was talking about earlier. :-)</p>



<a name="151733449"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Trait%20object%20upcast/near/151733449" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Trait.20object.20upcast.html#151733449">(Dec 13 2018 at 21:14)</a>:</h4>
<p><span class="user-mention" data-user-id="131912">@dhardy</span> and I could definitely use your input/advice on some of the above.</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>